UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DzO0hBSbZBWWZ2AAhhSN5ainNbPtE1g4yzcyk5KqQts='
WHERE
key_id = '09c377c31fab24b83be5b3295fae5111bf182d53973822c89c75494d14f36b9d'
AND (
token = 'DzO0hBSbZBWWZ2AAhhSN5ainNbPtE1g4yzcyk5KqQts='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)