UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4epTw5XYcDBnETjArS43xL9wIhdhJtnVPOSQZoPKS54='
WHERE
key_id = '00a50d05a08c2d39e0c0298a8ddcf693361ddd7bce8c97f6ae6276ca7c6645d9'
AND (
token = '4epTw5XYcDBnETjArS43xL9wIhdhJtnVPOSQZoPKS54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)