UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fw/q6ndHY0rQI2jSEXs6xOfddZ7n1OfZ3GoPC28vSpc=' 
WHERE 
  key_id = 'cd02a5baf0ae71fcb0d7b62648c2f1f63fa602e92a0b9336c2ebfc1006cafbae' 
  AND (
    token = 'Fw/q6ndHY0rQI2jSEXs6xOfddZ7n1OfZ3GoPC28vSpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023