UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LVRMkRYww2OMzQ5vYBL1eAeLE9XAINdfCjOX+5gMP6M='
WHERE
key_id = '582931c08390400413711756bf21d78f66251baa2a75114ab2e96235261552e7'
AND (
token = 'LVRMkRYww2OMzQ5vYBL1eAeLE9XAINdfCjOX+5gMP6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)