UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Seeh4rDiJAi0EblzfmhRDDr7SjLGJabFb9kZEGk/zFQ=' 
WHERE 
  key_id = '980ddbb600e14a10496c709a9334d44571d8f5f51699f5ecf17119006cf7914a' 
  AND (
    token = 'Seeh4rDiJAi0EblzfmhRDDr7SjLGJabFb9kZEGk/zFQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046