UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G7b+F5AuUdWzxqREjc5Ln/m2ljnUDzuz1CakdtjXRLc=' 
WHERE 
  key_id = 'dc50e82fadfc94bc52ccd29c0eeadcd70f85ac8aeb2776abe14a2c8dd3be5348' 
  AND (
    token = 'G7b+F5AuUdWzxqREjc5Ln/m2ljnUDzuz1CakdtjXRLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029