UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UB1rbiv31BB7oVE7rijeEqjOWEtXDGf89P2cklPr7KA=' 
WHERE 
  key_id = '207260fca76a9883aace17a9d3c12dcdeb7d527e1dd9f068efd676ced687f61c' 
  AND (
    token = 'UB1rbiv31BB7oVE7rijeEqjOWEtXDGf89P2cklPr7KA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027