UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hH2CPc4qixEwnciq47m89BJFXXTYZTmrKFvZKSb/3jY='
WHERE
key_id = '0948589c9530eb929e6b6d1160dbf0c46086aa99d4ed432049c5e55c1e1ea254'
AND (
token = 'hH2CPc4qixEwnciq47m89BJFXXTYZTmrKFvZKSb/3jY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)