UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vEGXmL8wvSEvEFek04Ptga5D5X+jmVXq4yRGwy+57l8='
WHERE
key_id = 'ff59ef86a882ce41e95ead6a4d2e2a476189c34a9998a7339ff414a8d6b5f6fa'
AND (
token = 'vEGXmL8wvSEvEFek04Ptga5D5X+jmVXq4yRGwy+57l8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)