UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm0pEdXMrJZsZpOw4pOQnQG5u/9q9CiN2yZ1axI3XcoM='
WHERE
key_id = 'ef7cdc108b8d62ca8c62553f45c002a9956d648544c31dd29696f98ef5d7ecf4'
AND (
token = 'm0pEdXMrJZsZpOw4pOQnQG5u/9q9CiN2yZ1axI3XcoM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)