UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f3RdKgT6ZjyxyHoI5xo1lP4/S64gxSewp+DZiJ7ZApM='
WHERE
key_id = '5b6302cf0b6929ccd1c245b81ece2040d2944ddf3f808e99e7df51d991aac4be'
AND (
token = 'f3RdKgT6ZjyxyHoI5xo1lP4/S64gxSewp+DZiJ7ZApM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)