UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L4/+ozb5njfeB/D9YBzKdX7wZP7BJwiQQMA4pdzOzlc=' 
WHERE 
  key_id = '68dfb2e15d61d48116f432c644821f80b1791499eea29b5d8302e23c96bc2aa5' 
  AND (
    token = 'L4/+ozb5njfeB/D9YBzKdX7wZP7BJwiQQMA4pdzOzlc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020