UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '71QYHutALeFTB0h4rk4X7p4W7fs491P24w+RPWWUp2Q=' 
WHERE 
  key_id = '011e145238135dc90111f0846617e02a6488db7a0880f2401addda25c143770f' 
  AND (
    token = '71QYHutALeFTB0h4rk4X7p4W7fs491P24w+RPWWUp2Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029