UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1VJm/f01AxgpxAltMNyHJDBBUDHcab1JFCbUjhS3EF0='
WHERE
key_id = '8e8d4eedfae3d2e916ca0d61f48771296a8ca5066c9f498bfbc35cc846045c7d'
AND (
token = '1VJm/f01AxgpxAltMNyHJDBBUDHcab1JFCbUjhS3EF0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)