UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+DYbqJ/xQvwWR9BKeJi47SJ1SFxqmobccSZe2Q22jcc='
WHERE
key_id = '86b5dc5166d7d0c7dd655f8d35d235defce6973705049983ebcecd2a2b153ee4'
AND (
token = '+DYbqJ/xQvwWR9BKeJi47SJ1SFxqmobccSZe2Q22jcc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)