UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cCrp1Q8i5gZfN+xNaZOpcPXjeN4nlsUusBLdbkffvWc=' 
WHERE 
  key_id = 'fc69c5fd4282dd9c99f4a0fb59adfd3055878c645f5332b983672be6ce3a9608' 
  AND (
    token = 'cCrp1Q8i5gZfN+xNaZOpcPXjeN4nlsUusBLdbkffvWc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036