UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dW8KBQhe8iDQrrYjaggqKUnCgvy6nqXZubO05Is7PoI=' 
WHERE 
  key_id = 'fb776fb10b80a8789f3ad18e62625ec9c551d6ab900dbaabe5b6621bc25f5a70' 
  AND (
    token = 'dW8KBQhe8iDQrrYjaggqKUnCgvy6nqXZubO05Is7PoI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044