UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7GB96BxEnDYw2lpTWcHO9YN5L7mB9a0r1knUBTz6kYg=' 
WHERE 
  key_id = '76239883b56c44e27bcf247db2edd435251baebe587775e910e36443190e2229' 
  AND (
    token = '7GB96BxEnDYw2lpTWcHO9YN5L7mB9a0r1knUBTz6kYg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014