UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tp+5BINpriuht2tjDTqsYAj+8paP0+8ftHwxJ2WxiO8=' 
WHERE 
  key_id = '2c872ba8781d74923ff1d862210341cb39fad10357c3cc1e5adddd45b1ef5bf5' 
  AND (
    token = 'tp+5BINpriuht2tjDTqsYAj+8paP0+8ftHwxJ2WxiO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00081