UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HBqvLE+St8An3epfc+3o9jAISVUDw17oxwdCXt+cu/c='
WHERE
key_id = '50e9b36997c9d453de06d6b1a009463134b80f1e790d82f8fdf5dc4062cc187e'
AND (
token = 'HBqvLE+St8An3epfc+3o9jAISVUDw17oxwdCXt+cu/c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)