UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PhEfK37ydrafYzm/0zMVoDIQD/+0qpQyxkcluWg5HvI='
WHERE
key_id = '429e76b3fe9a021c542002d4b6c6247b8b30bb7ab80d306525b4f4496cd89afb'
AND (
token = 'PhEfK37ydrafYzm/0zMVoDIQD/+0qpQyxkcluWg5HvI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)