UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ez5402PV3QCxi63rgPbQtiK5LmOTwBvyFbmYwPC5WA='
WHERE
key_id = '227ea6862512cd22defae0706f8297afde68de8b691b8605929b2f5035dd7556'
AND (
token = '4ez5402PV3QCxi63rgPbQtiK5LmOTwBvyFbmYwPC5WA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)