UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OxEnoLfn+jwhpnbbGLyhmHPJQhUpopKgtkXgNC07tAg=' 
WHERE 
  key_id = '775a78bb53056d45f31c172d1919d6d5100846ba04c714212915e5759aec6423' 
  AND (
    token = 'OxEnoLfn+jwhpnbbGLyhmHPJQhUpopKgtkXgNC07tAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054