UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z68tK68hMLvvVZKyNXN0T/VT3s3VDqcyfrlnmf6egNc=' 
WHERE 
  key_id = '238802c0cfb4c21c8c5459bb2436cd8459c32b69a1e44a652aac39161393ca1b' 
  AND (
    token = 'z68tK68hMLvvVZKyNXN0T/VT3s3VDqcyfrlnmf6egNc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056