UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LOp190BWo65rVA/wmReujHOgI2VZtcG7wgZL9HJKlYk=' 
WHERE 
  key_id = '744d88ac977f23cebac4312464589797c755c2ac2127981bce9e77cb2f8c2ad8' 
  AND (
    token = 'LOp190BWo65rVA/wmReujHOgI2VZtcG7wgZL9HJKlYk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038