UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vr87AFvJdPpuUJow+wi7RIqGF/TXlnaAyZSbxKLqN+U=' 
WHERE 
  key_id = '46195b8a762736857f835174bbfc4cce356c8597e688d34f61bfda5e7bca67e7' 
  AND (
    token = 'vr87AFvJdPpuUJow+wi7RIqGF/TXlnaAyZSbxKLqN+U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033