UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wuCGQYIPFAf5lrQqveyBAaUOSvyz9wDRPs4/SrUhHvM='
WHERE
key_id = 'df95bde4ae311962e7c0319801a6f6379b0ac37e5a905b0a4227073b8fe5d692'
AND (
token = 'wuCGQYIPFAf5lrQqveyBAaUOSvyz9wDRPs4/SrUhHvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)