UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NI10E3Qs8AU9IbQxjTS4oaGz/IvtWLo5ougtIOKETA4='
WHERE
key_id = '45dbd1667771641a75954710a04844b0afacd2918481f49fe3a75f09dc85b8c2'
AND (
token = 'NI10E3Qs8AU9IbQxjTS4oaGz/IvtWLo5ougtIOKETA4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)